﻿package nieAS.html {
	import flash.external.ExternalInterface;
	
	public class js {
		private static var bType:String = "unKnow";
		
		public static function getBrowserType():String {
			if (ExternalInterface.available == true) {
				bType = ExternalInterface.call("function getBrowser(){return navigator.userAgent;}");
				if (bType != null) {
					bType = bType.toLowerCase();
				} else {
					bType = "unKnow";
				}
			}
			return bType;
		}
		
		public static function getHtmlHref():String {
			if (ExternalInterface.available == true) {
				var _page:String = ExternalInterface.call("window.location.href.toString");
				return _page;
			} else {
				return null;
			}
		}
		
		public static function getParameters(_href:String = null):Object {
			var href:String = _href == null ? getHtmlHref() : _href;
			return href;
		}
	}
}